package com.sinopac.util;

//import java.io.FileInputStream;
//import java.io.FileNotFoundException;
//import java.io.IOException;
//import java.util.Properties;
import java.io.File;
import java.util.ResourceBundle;

public class PropsUtil {
//	private static Properties props;

//    private static void loadProperties() {
//         props = new Properties();
//         try {
//              props.load(new FileInputStream("/config.properties"));
//         } catch (FileNotFoundException e) {
//              e.printStackTrace();
//         } catch (IOException e) {
//              e.printStackTrace();
//         }
//    }

    public static String getConfig(String key) {
//    	loadProperties();
    	ResourceBundle bundle = ResourceBundle.getBundle("config");
    	File file = new File(bundle.getString(key));
    	if(file.isAbsolute()){
    		if(!file.exists()){
    			file.mkdirs();
    		}
    	}
        return bundle.getString(key);
    }

}
